package com.agent.membership.entity;

import com.agent.common.entity.BaseEntity;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.time.LocalDateTime;

/**
 * 积分交易记录实体
 * @author Jeff_Wan
 * @description 记录积分的所有交易明细
 */
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("credit_transaction")
public class CreditTransaction extends BaseEntity {
    /**
     * 账户ID
     */
    private Long accountId;

    /**
     * 用户ID
     */
    private Long userId;

    /**
     * 交易类型(INCOME/EXPENSE)
     */
    private String transactionType;

    /**
     * 积分类型(SUBSCRIPTION/BONUS)
     */
    private String creditType;

    /**
     * 积分数量
     */
    private Integer amount;

    /**
     * 来源描述
     */
    private String source;

    /**
     * 详细描述
     */
    private String description;

    /**
     * 关联ID(任务ID/订单ID等)
     */
    private Long relatedId;

    /**
     * 是否过期
     */
    private Boolean expired;

    /**
     * 过期时间(UTC时间)
     */
    private LocalDateTime expireAt;
}